<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<script lang="text/javascript">   
	//根据ID获取论坛信息对象
	function query_by_id( id, serviceName ) {
		if( id == null || id == undefined || id == "" ){
			alert("请输入ID");
			return false;
		}
		var query_url = '../jaxrs/'+serviceName+'/' + id;
		send_get_request( query_url );
	}
	//保存论坛信息对象
	function saveEntity(serviceName) {
		var url = '../jaxrs/' + serviceName;
		send_post_request( url );
	}
	//根据ID删除论坛信息对象
	function deleteEntity( id, serviceName ) {
		if( id == null || id == undefined || id == "" ){
			alert("请输入ID");
			return false;
		}
		var url = '../jaxrs/' + serviceName ;
		send_delete_request( url, id );
	}
	
	/////////////////////////////////////////////////////////////////////////////////////////////////
	var serviceName = "permission";
    $(document).ready(function() {
    	$('#all').click(function() {
    		send_get_request( '../jaxrs/' + serviceName + "/all" );
        });
    	$('#get').click(function() {
    		query_by_id($('#id').val(), serviceName);
        });
        $('#post').click(function() {
        	saveEntity(serviceName);
        });
        $('#delete').click(function() {
        	deleteEntity( $('#id').val(), serviceName );
        });
    });    
</script>
</head>
<body>
<div style="float: left; width: 720px;">
	<div style="width: 100%;">
		<table border="1" style="width:100%">
	    	<tr>
				<td>ID:</td>
				<td><input type="text" id="id" style="width:95%"/></td>
			</tr>
	    	<tr>
				<td>type:</td>
				<td>
	    			权限信息（BBSPERMISSIONINFO）
	    		</td>
			</tr>
	    	<tr>
				<td colspan="2">
					<button id="all">ALL</button>
					<button id="get">GET</button>
					<button id="post">POST</button>
					<button id="delete">DELETE</button>
				</td>
			</tr>
			<tr>
				<td colspan="2">
					<textarea id="content" style="width:97%;height:300px">{}</textarea>
				</td>
			</tr>
			<tr>
				<td colspan="2">
					<textarea id="result" style="width:97%;height:400px"></textarea>
				</td>
			</tr>
	    </table>
	</div>
</div>
		
		
</body>
</html>